package jdbc;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.Scanner;

public class UpdatePWD {
    public static void main(String[] args) {
        UserInfo userInfo = InputUtil.getInputObject(new UserInfo(), "修改密码", "修改密码");
        try ( Connection connection=DBUtil.getConnection()){

            //获取执行对象
            Statement statement=connection.createStatement();


            String sql1="update userinfo set password ='"+userInfo.getPassword()+"' where username='"+userInfo.getUsername()+"'";
            System.out.println(sql1);
        } catch (SQLException e) {
            e.printStackTrace();
        }

    }
}
